package first;

public class Rectangle extends Shape{
	double x;
	double y;
	double l;
	double w;
	
	public Rectangle(double x, double y, double l, double w) {
		super();
		this.x = x;
		this.y = y;
		this.l = l;
		this.w = w;
	}

	double getArea(double l,double w) {
		return this.l*this.w;
	}

	boolean isContains(Point P) {
		
		if(P.getX()<x+l && P.getX()>(x) && P.getX()<y+l && P.getY()>y)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	boolean isContains(int a, int b) {
		if(a<x+l && a>x && b<y+l && b>y)
		{
			return true;
		}
		else
		{
			return false;
		}
		
	}

	double getArea(double r) {
		return 0;
	}
	public String toString() {
		return "the Rectangle area is:"+String.format("%.2f", this.getArea(x,y));
	}
	
	
}
